
//
//  GradientColorTool.m
//  ShrimpCrowdordering
//
//  Created by jimmy on 2018/8/25.
//  Copyright © 2018年 郑洲. All rights reserved.
//

#import "GradientColorTool.h"

@implementation GradientColorTool

+(void)gradientColorFromView:(UIView *)view
{
    CAGradientLayer *gradient = [CAGradientLayer layer];
    //设置开始和结束位置(设置渐变的方向)
    gradient.startPoint = CGPointMake(0, 1);
    gradient.endPoint = CGPointMake(1, 1);
    gradient.frame = view.frame;
    gradient.colors = [NSArray arrayWithObjects:(id)[UIColor colorWithRed:135/255.0 green:219/255.0 blue:214/255.0 alpha:1].CGColor,(id)[UIColor colorWithRed:94/255.0 green:189/255.0 blue:205/255.0 alpha:1].CGColor,nil];
    [UIApplication sharedApplication].statusBarStyle=UIStatusBarStyleLightContent;
    
    [view.layer insertSublayer:gradient atIndex:0];
}

@end
